﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace LimpaGaragem.BLL.Product
{
    public class Photo
    {
        /// <summary>
        /// Return list of photo
        /// </summary>
        /// <returns></returns>
        public List<LimpaGaragem.Model.Product.Photo> GetListOfPhoto(int IDProduct)
        {
            try
            {
                return new LimpaGaragem.DAO.Product.Photo().GetListOfPhoto(IDProduct);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }

        /// <summary>
        /// Get photo
        /// </summary>
        /// <returns></returns>
        public LimpaGaragem.Model.Product.Photo GetPhoto(int IDPhoto)
        {
            try
            {
                return new LimpaGaragem.DAO.Product.Photo().GetPhoto(IDPhoto);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }

        /// <summary>
        /// Insert new photo
        /// </summary>
        public int InsertPhoto(int IDProduct,
                               byte[] ImagePhoto)
        {
            try
            {
                return new LimpaGaragem.DAO.Product.Photo().InsertPhoto(IDProduct, ImagePhoto);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }

        /// <summary>
        /// Delete photo
        /// </summary>
        public void DeletePhoto(int IDPhoto)
        {
            try
            {
                new LimpaGaragem.DAO.Product.Photo().DeletePhoto(IDPhoto);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
    }
}
